package com.estate.service.detail;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.estate.mapper.DetailMapper;
import com.estate.pojo.Detail;
import com.estate.pojo.Project;
import com.estate.pojo.Region;

@Service
public class DetailServiceImpl implements DetailService {
	@Autowired
	private DetailMapper detailMapper;

	@Override
	public Detail selectDetail(Integer project_id, Integer det_id) throws Exception {
		return detailMapper.selectDetail(project_id, det_id);
	}

	@Override
	public List<Detail> selDetail() throws Exception {
		return detailMapper.selDetail();
	}

	 /**
     * 按照项目id查看该项目下的楼栋信息
     * @return
     */
	@Override
	public List<Detail> selectDetByProId(Integer ProId) {
		List<Detail> detailList = new ArrayList<>();
		try {
			detailList = detailMapper.selectDetByProId(ProId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return detailList;
	}

	/**
	 * 查询分期项目的编号
	 */
	@Override
	public List<Detail> findDetCodingByProId(Integer ProId) {
		List<Detail> detCodingList = new ArrayList<>();
		try {
			detCodingList = detailMapper.findDetCodingByProId(ProId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return detCodingList;
	}

	@Override
	public List<Detail> getMessByPorId(Integer ProId) {
		List<Detail> porjectlist = new ArrayList<>();
		try {
			porjectlist = detailMapper.getMessByPorId(ProId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return porjectlist;
	}

	@Override
	public List<Detail> findCodeByProId(Integer ProId){
		List<Detail> codelist = new ArrayList<>();
		try {
			codelist = detailMapper.findCodeByProId(ProId);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return codelist;
	}

	
	
}
